﻿using Microsoft.SharePoint.ApplicationPages.Calendar.RecurrenceRule;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WindStyle.SPCalendar.Pattern
{
    public class DailyByFrequencyPattern : IPattern
    {
        public int Frequency { get; set; }

        public DailyByFrequencyPattern()
        {
            this.Frequency = 1;
        }

        public string ToXML()
        {
            return "<daily dayFrequency=\"" + this.Frequency + "\" />";
        }

        public void FromRule(RecurrenceRule recurrence)
        {
            this.Frequency = recurrence.Frequency;
        }
    }
}
